package com.exam.meituan;

import java.util.*;

/**
 * date:
 * description:
 */
public class Solution103 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int[] upside = new int[n];
        int[] downside = new int[n];
        Map<Integer, Integer> upMap = new HashMap<>();
        for (int i = 0; i < n; i++) {
            upside[i] = scanner.nextInt();
            upMap.put(upside[i], upMap.getOrDefault(upside[i], 0) + 1);
        }
        Map<Integer, Integer> totalMap = new HashMap<>(upMap);
        for (int i = 0; i < n; i++) {
            downside[i] = scanner.nextInt();
            if(downside[i] != upside[i]) {
                totalMap.put(downside[i], totalMap.getOrDefault(downside[i], 0) + 1);
            }
        }
        ArrayList<Integer> candidates = new ArrayList<>();
        int half = n / 2;
        if (n % 2 == 1) {
            half++;
        }
        for (Integer key : totalMap.keySet()) {
            if(totalMap.get(key) >= half) {
                candidates.add(key);
            }
        }
        if(candidates.isEmpty()) {
            System.out.println(-1);
            return;
        }
        int res = Integer.MAX_VALUE;
        for (Integer candidate : candidates) {
            int currentVal = upMap.getOrDefault(candidate, 0);
            res = Math.min(res, half - currentVal);
        }
        if(res < 0) {
            res = 0;
        }
        System.out.println(res);
    }
}
